<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Axios远程调用练习</title>
	</head>
	<body>
		<script src="../../Js/axios.js"></script>
		<script>
			/*1.post请求说明 form表单提交/新增入库时*/
			/* 2.需求：实现用户信息新增 id/name/age/sex */
			let user ={
				name: '建党一百年',
				age: 100,
				sex: '未知'
			}
			//post请求的参数,直接传递
			axios.post("http://localhost:8099/SaveUser",user)
				.then(result =>{
					console.log(result.data)
				})
				
			/**
			 * 利用restFul风格实现用户新增
			 */
			axios.post("http://localhost:8099/user/好生活/100/其他")
				.then(result =>{
					console.log(result.data)
				})
				
			/**
			 * PUT 修改操作
			 */
			axios.post("http://localhost:8099/user/好生活/100/其他")
				.then(result =>{
					console.log(result.data)
				})
		</script>
	</body>
</html>
